package cn.work.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/*数据库连接工具类*/
public class DataBaseutil {
    public static Connection getConnection() {
        Connection connection = null;
        try {

            // 加载MySQL驱动（根据实际数据库类型修改）
            Class.forName("com.mysql.cj.jdbc.Driver");
            // 建立连接，这里的URL、用户名和密码需要根据实际情况修改
            connection = DriverManager.getConnection("jdbc:mysql://gz-cdb-huxxjxlz.sql.tencentcdb.com:25149/meirongyuan?serverTimezone=UTC&useSSL=false", "root", "hzxy12345");
        } catch (ClassNotFoundException | SQLException e) {
            e.printStackTrace();
        }
        return connection;
    }
}